﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DoveyAttribute.ValidateExtend
{
    /// <summary>
    /// 日期的验证
    /// </summary>
    public class BirthdayValidateAttribute : AbstractValidateAttribute
    {
        //public DateTime _
        public override bool Validate(object obj)
        {
            //throw new NotImplementedException();
            return obj != null
                && DateTime.TryParse(obj.ToString(), out DateTime nNow)
                && nNow <= DateTime.Now
                && nNow >=DateTime.MinValue;
        }
    }
}
